<!-- 继承form.html模板 -->
{% extends "public/form.html" %}
{% block content %}
    <form class="layui-form model-form" action="">
        <input name="id" id="id" type="hidden" value="{{data.id|default(0)}}">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">广告标题：</label>
                <div class="layui-input-inline">
                    <input name="title" value="{{ data.title }}" lay-verify="required" autocomplete="off"
                           placeholder="请输入广告标题" class="layui-input" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">广告位置：</label>
                <div class="layui-input-inline">
                    {{ "sort_id|1|广告位置|name|id"|select(sortList, data.sort_id) }}
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">广告地址：</label>
                <div class="layui-input-inline">
                    <input name="url" value="{{ data.url }}" lay-verify="required" autocomplete="off"
                           placeholder="请输入广告地址" class="layui-input" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">广告类型：</label>
                <div class="layui-input-inline">
                    {{ "type|1|广告类型|name|id"|select(typeList, data.type) }}
                </div>
            </div>
        </div>
        <div class="layui-form-item cover">
            <label class="layui-form-label">广告封面：</label>
            {{ "cover|封面|90x90|建议上传尺寸450x450"|image(data.cover, "", 0) }}
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">封面宽度：</label>
                <div class="layui-input-inline">
                    <input name="width" value="{{ data.width }}" lay-verify="required|number" autocomplete="off"
                           placeholder="请输入封面宽度" class="layui-input" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">封面高度：</label>
                <div class="layui-input-inline">
                    <input name="height" value="{{ data.height }}" lay-verify="required|number" autocomplete="off"
                           placeholder="请输入封面高度" class="layui-input" type="text">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">开始时间：</label>
                <div class="layui-input-inline">
                    {{ "start_time|1|开始时间|datetime"|date(data.start_time) }}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">结束时间：</label>
                <div class="layui-input-inline">
                    {{ "end_time|1|结束时间|datetime"|date(data.end_time) }}
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">广告状态：</label>
                <div class="layui-input-inline">
                    {{ "status"|switch("在用|停用", data.status|default(1)) }}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">排序号：</label>
                <div class="layui-input-inline">
                    <input name="sort" value="{{ data.sort }}" lay-verify="required|number" autocomplete="off"
                           placeholder="请输入序号" class="layui-input" type="text">
                </div>
            </div>
        </div>
        <div class="layui-form-item layui-form-text" style="width:625px;">
            <label class="layui-form-label">广告备注：</label>
            <div class="layui-input-block">
                <textarea name="note" placeholder="请输入广告备注"
                          class="layui-textarea">{{ data.note }}</textarea>
            </div>
        </div>
        <div class="layui-form-item" style="width:1000px;">
            <label class="layui-form-label">广告内容：</label>
            <div class="layui-input-block">
                <textarea name="content" id="content" lay-verify="required" class="layui-textarea">{{ data.content }}</textarea>
                {{ "content"|editor("default", "80%", 350) }}
            </div>
        </div>
        {{ "submit|立即保存,close|关闭"|submit(1, "") }}
    </form>
{% endblock %}